Object-oriented programming (OOP) has become popular in recent years because it facilitates code reuse, code sharing and the reduction of dependencies among different software. Java™, one of the most popular object-oriented languages, is often used for Internet applications, in large part because of its relative platform independence. Nevertheless, Java™ applications, like those of other object-oriented languages, may execute significantly slower than an application written in other programming languages such as C. One of the challenges for programmers is how to minimize the decrease in computing speed that typically occurs with memory allocations and de-allocations in OOP.
A Java™ program is comprised of numerous Java™ classes, which are compiled into machine-independent bytecode class files. Each class contains code and data in a platform-independent class file format. A computer system containing an interpretive program called a Java™ Virtual Machine (JVM) executes the code in the Java™ classes, which provides a level of abstraction between the bytecode classes and an instruction set of the computer hardware. A class loader within the JVM loads the bytecode class files as needed, and either an interpreter executes the bytecodes directly, or a “just-in-time” (JIT) compiler translates the bytecodes into native machine code so that the code can be executed by the processor.
Java™ and other object-oriented programming languages are attractive for programming various web-enabled wireless devices such as personal digital assistants and mobile phones. For these devices having limited memory and power, efficient use of memory becomes critical to their performance. Many commercially available wireless communication devices employ processes that statically assign certain algorithms at compile time to the fastest memory of the devices, which may lead to reducing the total amount of code that can be run from limited-size, high-speed internal random-access memory (IRAM), also referred to as cache memory.
In an exemplary mobile phone, the baseband processor internal memory used by the radio operating system has inefficiencies. This is because all code that is assigned to run from IRAM is statically linked, while other time-sensitive code cannot use the fastest processing memory, even when the code currently using the fast memory does not need to execute. For example, if the internal memory is 64 kilobytes in size, only 64 kilobytes worth of statically assigned code can use the fastest memory and the code may include unneeded functions. The Java™-run wireless device in this particular case employs a JIT compiler to generate native code from Java™ bytecode.
When a JIT compiler is used in a wireless device to generate and pre-compile native code, the native code may actually run slower than the original Java bytecode from the JVM when code is executed from flash rather than internal memory, resulting in a decrease in performance. Thus, an increase in the run-time speed of mobile information device applets (MIDlets), i.e. small Java™ applications used in mobile devices, would improve the overall performance of a device. In addition, any methods or processes that make Java™ compilations more efficient in mobile devices could also benefit non-Java™ applications such as screen refresh rates for an application programming interface (API) of a digital camera or a liquid-crystal display (LCD) display driver.
Therefore, the need still exists for a method that improves the performance speed of operating systems found in wireless communication devices such as mobile phones. The improved method and associated wireless device would be able to effectively load and execute the most critical code in the fast internal memory available at application run time, resulting in increased run-time speed and performance of a device, as well as overcoming the limitations described above.